package 设计模式.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class InfoCollege implements College{
    List<Department> departmentsList;

    public InfoCollege() {
        departmentsList=new ArrayList<Department>();
        addDepartment("信息","信息");
        addDepartment("网络","网络");
        addDepartment("服务器","服务器");
    }

    @Override
    public String getName() {
        return "信息工程学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        Department department=new Department(name,desc);
        departmentsList.add(department);
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterator(departmentsList);
    }
}
